package com.fit.carservice.pages;

import org.apache.tapestry5.annotations.InjectPage;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SetupRender;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.fit.beans.CityBean;
import com.fit.interfaces.CityI;
import com.fit.service.CitiesI;

public class EntryCity
{

	@Persist
	@Property
	private CityI currentCity;
	
	@Inject
	private CitiesI cities;
	
	@InjectPage
	private ViewCity viewCityPage;
	
	@SetupRender
	public void createObject(){
		currentCity = new CityBean();
	}
	
	Object onSuccess(){
		cities.save(currentCity);
		return viewCityPage;
	}
}
